

function check_passwd(username, passwd) {
    console.log("username = %s", username.value)
    console.log("passwd = %s", passwd.value)
    

    for (var k = 0; k < _TheArray.length; k++) {
        if ((username.value == _TheArray[k][0]) && (passwd.value == _TheArray[k][1])) {
            return true
        }
    }
    return false
}

function login() {

    var username = document.getElementById("username");
    var pass = document.getElementById("password");

    if (username.value == "") {

        alert("请输入用户名");

    } else if (pass.value == "") {

        alert("请输入密码");

    } else if (check_passwd(username, pass) == true) {

        window.location.href = "main.html";

    } else {

        alert("请输入正确的用户名和密码！")

    }
}